@extends('default.layouts.companyPublic')

@section('title', '企业账户中心')
@section('headcss')
    @parent
    <link rel="stylesheet" type="text/css" href="{{asset('/default/css/company/myOrder.css')}}">
@endsection
@section('rightcon')
    <div class="right">
        <!--菜单-->
        <div class="jright">
            <div class="content">
                <div class="jobtitle">
                    <div class="tithead">
                        <ul>
                            <li class="active"><a href="{{ route('myOrder.index') }}">我的套餐</a></li>
                            <li><a href="{{ route('myOrder.list') }}">我的定单</a></li>
                            <li><a href="{{ url('company/member_records') }}">会员记录</a></li>
                            @if(!empty(auth()->guard('company')->user()->stop_number))
                                <li><a href="{{ url('company/start_stop') }}">会员启停</a></li>
                            @endif
                        </ul>
                    </div>
                </div>

                {{--\会员信息--}}
                <div class="vipinfo">
                    <dl>
                        <dt>
                            <i></i>
                        </dt>
                        <dd><span>VIP</span><span>{{$vip['day']}}</span></dd>
                    </dl>
                    <dl class="c2">
                        <dt>
                            <i></i>
                        </dt>
                        <dd><span>职位数</span><span>{{$vip['post_number']}}个</span></dd>
                    </dl>
                    <dl class="c3">
                        <dt>
                            <i></i>
                        </dt>
                        <dd><span>简历数</span><span>{{$vip['resume_number']}}份</span></dd>
                    </dl>
                    <dl class="c4 end">
                        <dt>
                            <i></i>
                        </dt>
                        <dd><span>积分</span><span>{{$vip['integral']}}个</span></dd>
                    </dl>
                </div>
            </div>
        </div>

        <div class="rightContain">


            <div class="rightBottom">
                <ul>
                    @if(count($VipPackage) > 0)
                        @foreach($VipPackage as $k => $v)
                            <li @if(($k+1) % 3 == 0) class="noRightBorder" @endif>
                                <h3><i></i><span class="title">{{ $v->vipname }}</span></h3>
                                <span>
                                    <h5>
                                        <i>￥</i>
                                        <span>{{ $v->money }}</span>
                                        <em>{{ $v->vip_days }}天</em>
                                    </h5>
                                </span>
                                @if(($v->vip_resume_number + $v->resume_number) < 1)
                                    <p class="bg"><i class="through">套餐简历数</i><em class="through">{{ $v->vip_resume_number + $v->resume_number }}</em></p>
                                @else
                                    <p class="bg"><i>套餐简历数</i><em>{{ $v->vip_resume_number + $v->resume_number }}</em></p>
                                @endif
                                @if(($v->vip_integral + $v->integral) < 1)
                                    <p><i class="through">套餐积分</i><em class="through">{{ $v->vip_integral + $v->integral }}</em></p>
                                @else
                                    <p><i>套餐积分</i><em>{{ $v->vip_integral + $v->integral }}</em></p>
                                @endif
                                @if($v->vip_post_number < 1)
                                    <p class="bg"><i class="through">套餐职位数</i><em class="through">{{ $v->vip_post_number }}</em></p>
                                @else
                                    <p class="bg"><i>套餐职位数</i><em>{{ $v->vip_post_number }}</em></p>
                                @endif
                                <input type="hidden" value="{{ $v->token }}">
                                @if(!empty(Site::get('weiXinPayMCHID')) || !empty(Site::get('aLiPayPartner')))
                                    <input type="button" value="立即购买">
                                @else
                                    <a class="link" href="{{ route("WebContent",['contactus']) }}" target="_blank">立即购买</a>
                                @endif
                                <input type="hidden" value="{{ $v->id }}">

                            </li>
                        @endforeach
                    @endif
                </ul>
            </div>
        </div>
    </div>
@endsection
@section('footerjs')
    @parent
    <script type="text/javascript">
    $(".rightBottom li").find("input[type=button]").click(function(){
        var d = new Date()
        var vYear = d.getFullYear()
        var vMon = d.getMonth() + 1
        var vDay = d.getDate()
        var h = d.getHours();
        var m = d.getMinutes();
        var se = d.getSeconds();
        s=vYear+(vMon<10 ? "0" + vMon : vMon)+(vDay<10 ? "0"+ vDay : vDay)+(h<10 ? "0"+ h : h)+(m<10 ? "0" + m : m)+(se<10 ? "0" +se : se);
        token = $(this).prev().val();
        token += s;
        id = $(this).next().val();
        vip_name = $(this).parent().find('h3 span').html();
        money = $(this).parent().find('span h5 span').html();
        location.href = "{{ route("myOrder.list") }}?vip_id="+id+"&vip_name="+vip_name+"&token="+token+"&money="+money;
    });
    $("#leftnav_order").addClass("active");
    </script>
@endsection